title: Trigger lambda function with samlocal for SNS
body: <p>I am new to SAM-Local and am trying to use it to trigger a Lambda function from an SNS topic. When I run SAM Local like this:</p>
  
  <p><code>sam local invoke -t sam.yaml ServiceNowIncidentCreator -e sns_event.json</code></p>
  
  <p>My Lambda function does not get triggered.. I only see that the docker container starts and waits forever like this:</p>
  
  <pre><code>2018/03/13 18:39:17 Successfully parsed sam.yaml
  2018/03/13 18:39:17 Connected to Docker 1.32
  2018/03/13 18:39:17 Runtime image missing, will pull....
  2018/03/13 18:39:17 Fetching lambci/lambda:python3.6 image for python3.6    runtime...
  python3.6: Pulling from lambci/lambda
  5be106c3813f: Pull complete 
  e240967675e1: Pull complete 
  9e3a67ef4b55: Pull complete 
  f6645a04a4f3: Pull complete 
  4dfe0dcbdfa8: Pull complete 
  Digest: sha256:6626c2fe135d51952192273481decadbef184f528fc478c63d2379ed0efdb526
  Status: Downloaded newer image for lambci/lambda:python3.6
  2018/03/13 18:40:57 Reading invoke payload from stdin (you can also pass it from file with --event)
  --event
  </code></pre>
  
  <p>My sam.yml looks like this:</p>
  
  <pre><code>ServiceNowIncidentCreator:
      Type: 'AWS::Serverless::Function'
      Properties:
        Runtime: python3.6
        Timeout: 180
        Handler: servicenow_incident_creator.handler
        CodeUri: ./functions/servicenow_incident_creator
        Description: "Function to create Servicenow incidents from SNS notifications"
        Environment:
          Variables:
            JobQueuePrefixName: aws-hpc-shuklas-JobQueue-DEV
        Events:
    LambdaSNSTopic:
      Type: "AWS::SNS::Topic"
      Properties:
        DisplayName: "Lambda SNS topic"
        Subscription:
          -
            Endpoint:
              Fn::GetAtt:
                - "ServiceNowIncidentCreator"
                - "Arn"
            Protocol: "lambda"
        TopicName: "service-now-sns-topic"
  </code></pre>
  
  <p>..and my event.json looks like this:</p>
  
  <pre><code>cat sns_event.json 
  {
    "Records": [
      {
        "EventVersion": "1.0",
        "EventSubscriptionArn": "arn:aws:sns:EXAMPLE",
        "EventSource": "aws:sns",
        "Sns": {
          "SignatureVersion": "1",
          "Timestamp": "1970-01-01T00:00:00.000Z",
          "Signature": "EXAMPLE",
          "SigningCertUrl": "EXAMPLE",
          "MessageId": "95df01b4-ee98-5cb9-9903-4c221d41eb5e",
          "Message": "example message",
          "MessageAttributes": {
            "Test": {
              "Type": "String",
              "Value": "TestString"
            },
            "TestBinary": {
              "Type": "Binary",
              "Value": "TestBinary"
            }
          },
          "Type": "Notification",
          "UnsubscribeUrl": "EXAMPLE",
          "TopicArn": "arn:aws:sns:us-east-1:111122223333:ExampleTopic",
          "Subject": "example subject"
        }
      }
    ]
  }
  </code></pre>
  
  <p>What am I missing?</p>