Repository: aws-cloudformation/cfn-lint

Issue:
Incorrect rule: "E1019: Sub parameter should be an object of 1 or string for..."
*cfn-lint version: 0.40.0*

I am getting an incorrect error that [`E1019`](https://github.com/aws-cloudformation/cfn-python-lint/blob/master/docs/rules.md#E1019)` Sub parameter should be an object of 1 or string for...` when using YAML:

```
        - Fn::Sub:
            - 'example-${Var}-${Var2}'
            - Var: 123
              Var2: 456
```

Official docs: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-sub.html

Official docs sample:
```
Fn::Sub:
  - String
  - Var1Name: Var1Value
    Var2Name: Var2Value
```



Discussion:
Haven't looked into this yet, but getting thrown here:
https://github.com/aws-cloudformation/cfn-python-lint/blob/4ef277bb637c533582c2b10d3589b4aa3623f3bf/src/cfnlint/rules/functions/Sub.py#L88-L91

Resolving patch:
diff --git a/src/cfnlint/rules/functions/Sub.py b/src/cfnlint/rules/functions/Sub.py
--- a/src/cfnlint/rules/functions/Sub.py
+++ b/src/cfnlint/rules/functions/Sub.py
@@ -85,8 +85,8 @@ def _test_parameters(self, parameters, cfn, tree):
                     message = 'Sub parameter should be an object of 1 for {0}'
                     matches.append(RuleMatch(
                         param_tree, message.format('/'.join(map(str, tree)))))
-            elif not isinstance(parameter_value_obj, six.string_types):
-                message = 'Sub parameter should be an object of 1 or string for {0}'
+            elif isinstance(parameter_value_obj, list):
+                message = 'Sub parameter value should be a string for {0}'
                 matches.append(RuleMatch(
                     param_tree, message.format('/'.join(map(str, tree)))))
 


Test patch:
diff --git a/test/fixtures/templates/bad/functions/sub.yaml b/test/fixtures/templates/bad/functions/sub.yaml
--- a/test/fixtures/templates/bad/functions/sub.yaml
+++ b/test/fixtures/templates/bad/functions/sub.yaml
@@ -54,8 +54,10 @@ Resources:
     Properties:
       CidrBlock:
         Fn::Sub:
-        - "${myCidr}"
+        - "${myCidr}${number}"
         - myCidr: !Ref CidrBlock
+          number:
+          - bad
   LaunchConfiguration:
     Type: AWS::AutoScaling::LaunchConfiguration
     Properties:
diff --git a/test/fixtures/templates/good/functions/sub.yaml b/test/fixtures/templates/good/functions/sub.yaml
--- a/test/fixtures/templates/good/functions/sub.yaml
+++ b/test/fixtures/templates/good/functions/sub.yaml
@@ -13,6 +13,8 @@ Parameters:
     Description: App Package
   mySubnets:
     Type: List<AWS::EC2::Subnet::Id>
+  CidrBlock:
+    Type: String
 Resources:
   myInstance:
     Type: AWS::EC2::Instance
@@ -64,6 +66,14 @@ Resources:
     Properties:
       ProductName: example
       ProvisioningArtifactName: v1
+  myVPc2:
+    Type: AWS::EC2::VPC
+    Properties:
+      CidrBlock:
+        Fn::Sub:
+        - "${myCidr}${number}"
+        - myCidr: !Ref CidrBlock
+          number: 1
 Outputs:
   OutputSub:
     Value: !Sub '${ProvisionedProduct.Outputs.Example}-example'
diff --git a/test/unit/rules/functions/test_sub.py b/test/unit/rules/functions/test_sub.py
--- a/test/unit/rules/functions/test_sub.py
+++ b/test/unit/rules/functions/test_sub.py
@@ -23,4 +23,4 @@ def test_file_positive(self):
 
     def test_file_negative(self):
         """Test failure"""
-        self.helper_file_negative('test/fixtures/templates/bad/functions/sub.yaml', 15)
+        self.helper_file_negative('test/fixtures/templates/bad/functions/sub.yaml', 16)