Skip to content

Commit

Permalink
Add more exceptions E1040
Browse files Browse the repository at this point in the history
  • Loading branch information
kddejong committed Aug 29, 2024
1 parent 1a1447b commit a019e71
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/cfnlint/rules/functions/GetAttFormat.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ def __init__(self):
"AWS::ServiceCatalog::CloudFormationProvisionedProduct",
]

self._resource_type_attribute_exceptions = [("AWS::SSM::Parameter", "Value")]

def validate(
self, validator: Validator, _, instance: Any, schema: Any
) -> ValidationResult:
Expand All @@ -50,11 +52,15 @@ def validate(
t, validator.context.regions
):
region = regions[0]
getatt_ptr = validator.context.resources[resource].get_atts(region)[attr]

if t in self._resource_type_exceptions:
return

if (t, attr) in self._resource_type_attribute_exceptions:
return

getatt_ptr = validator.context.resources[resource].get_atts(region)[attr]

getatt_schema = resource_schema.resolver.resolve_cfn_pointer(getatt_ptr)
getatt_fmt = getatt_schema.get("format")
if getatt_fmt != fmt:
Expand Down

0 comments on commit a019e71

Please sign in to comment.