0.23.2Description of issue.
How to exclude single parameter(s) from W2001 check? We are using a framework that uses some of the CF input parameters in Metadata section as a data filter. Linter is complaining about those values that they are not in use though they are but they are only in the Metadata section. Of course it would be nice if the W2001 would support this kind of parameter usage without disabling the check.
Parameters:
Network:
Type: String
Metadata:
SNC::Parameter::Metadata:
SubnetPool:
datasource: getSubnetsByNetwork
datasourceFilter:
Network: Network
W2001 Parameter Network not used.
I'm not sure we have that capability. CloudFormation doesn't support additional items in the Parameter section for us to put that exception there. There is a long standing issue around using commends to do rule exceptions which could solve this issue.
A quick search seems to point at Service-Now. Is this what this is for? Gives me a good point of reference to look for some alternative options.
Yes this is for ServiceNow CMP module. It would be indeed nice to not to get that false positive for W2001 for parameters that are actually used in the Metadata section.
@Satak I've suppressed that warning in the past by referencing them in the Metadata.
Parameters:
Network:
Type: String
Metadata:
UnusedParams: # cfn-lint ignore
Network: !Ref Network
SNC::Parameter::Metadata:
SubnetPool:
datasource: getSubnetsByNetwork
datasourceFilter:
Network: Network
There are inline ignores at the resource-level using Metadata. Since the other template sections don't support Metadata, I think I'm going to merge this into https://github.com/aws-cloudformation/cfn-python-lint/issues/113
Most helpful comment
@Satak I've suppressed that warning in the past by referencing them in the Metadata.