Q:

aws VS2017 serverless app syntax in serverless.template to add filter to s3 notification

I have created a VS2017 C# app using the AWS Serverless Application template with the "Simple S3 Function" blueprint.  The CloudFormation serverless.template file contains a spec for my handler function with an event spec to respond to "s3.ObjectCreated:*" events.  I am trying to add a filter specification to that event spec to only respond to events with the "Source/" prefix.  Here is my code:
{
  "AWSTemplateFormatVersion" : "2010-09-09",
  "Transform" : "AWS::Serverless-2016-10-31",
  "Description" : "Template that creates a S3 bucket and a Lambda function that will be invoked when new objects are upload to the bucket.",
  "Parameters" : {
    "BucketName" : {
        "Type" : "String",
        "Description" : "Name of S3 bucket to be created. The Lambda function will be invoked when new objects are upload to the bucket. If left blank a name will be generated.",
        "MinLength" : "0"
    }
  },

  "Conditions" : {
    "BucketNameGenerated" : {"Fn::Equals" : [{"Ref" : "BucketName"}, ""]}
  },

  "Resources" : {

    "Bucket" : {
        "Type" : "AWS::S3::Bucket",
        "Properties" : {
            "BucketName" : { "Fn::If" : ["BucketNameGenerated", {"Ref" : "AWS::NoValue" }, { "Ref" : "BucketName" } ] }
        }
    },

    "S3Function" : {
      "Type" : "AWS::Serverless::Function",
      "Properties": {
        "Handler": "DCATInventory::DCATInventory.Function::FunctionHandler",
        "Runtime": "dotnetcore2.0",
        "CodeUri": "",
        "Description": "Default function",
        "MemorySize": 256,
        "Timeout": 30,
        "Role": null,
        "Policies": [ "AWSLambdaFullAccess", "AmazonRekognitionReadOnlyAccess" ],
        "Events": {
            "NewImagesBucket" : {
                "Type" : "S3",
                "Properties" : {
                    "Bucket" : { "Ref" : "Bucket" },
                    "Events" : [
                        "s3:ObjectCreated:*"
                    ],
                    "Filter" : {
                        "S3Key" : {
                            "Rules" : [{
                                "Name" : "prefix", 
                                "Value": "Source/"
                            }]
                        }
                    }
                }
            }
        }
      }
    }
  },
  "Outputs" : {
    "Bucket" : {
        "Value" : {"Ref":"Bucket"},
        "Description" : "Bucket that will invoke the lambda function when new objects are created."
    }
  }
}

This is the default code generated by the template with only the Filter spec added to the event properties.  I am receiving an error stating "Rules key is invalid for this object" on line 48.  I have read the documentation and googled this and this seems to be the correct syntax.  Did I specify something wrong here?  Thanks in advance.

A:

It turns out my syntax shown above is correct even though Visual Studio is reporting an error.  I decided to try publishing the app to AWS even with this error.  I expected I would get an error from CloudFront, but it published successfully.  The S3 Event did publish and contains my filter rule with the "Source/" prefix.

