Closed jtherrmann closed 5 days ago
Looks like this may just be an issue when JSON is used within a YAML template, as the error goes away when I convert the JSON portion to YAML. Is mixing the two no longer supported as of v1.3.4?
Its how some of the items get codified into the schema. Previously there was a type of json
and now in some resource schemas we are getting just {"type": "object"}
. The easy fix is to patch those with {"type": ["object", "string"]}
. Ideally we would be able to identify these situations and valid the string is JSON. Working on a solution for this shortly.
We may have a short term and a long term solution to this btw.
@kddejong Sounds great, thanks!
This PR should allow any of these json properties to be either string or an object. While doing this work I found a chunk of resources that were only providing "type": "object" for the Tags
property so I patched those as well.
This should now be resolved with the recent release. Let me know if you are still having issues. There are some more steps to be done to improve the validation but that can come later.
@kddejong Thank you!
CloudFormation Lint Version
1.3.4
What operating system are you using?
Ubuntu 24.04 LTS
Describe the bug
We have a
AWS::SNS::Subscription
resource as part of our CloudFormation template here. We provide ourFilterPolicy
as a JSON object, as specified in the CloudFormation docs. However, runningcfn-lint
v1.3.4 on our template gives the following error:This error does not appear with the previous release of
cfn-lint
, v0.87.8.Expected behavior
This error should not appear, because we are specifying our
FilterPolicy
as a JSON object, which matches the CloudFormation docs.Reproduction template
The full template is available here and the relevant resource block is here: