title: How to use Serverless functions, says doesn't exist
body: <p>I am trying to deploy my first serveless project and want to have it update a simple item in my dynamodb. So I started making a simple service in serverless.yml:</p>
  
  <pre><code>service: serverless
      provider:
        name: aws
        runtime: nodejs4.3
        iamRoleStatements:
          - Effect: "Allow"
            Resource: "*"
            Action:
              - "dynamodb:*"
      functions:
        createMovie:
          handler: handler.createMovie
          events:
            - http:
                path: movies/create
                method: post
                integration: lambda
                cors: true
  </code></pre>
  
  <p>Then I found some more code online to link up the dynamodb portion of my app and added it into serverless.yml at the bottom:
  resources:  </p>
  
  <pre><code>  Resources:
      DynamoDbTable:
        Type: AWS::DynamoDB::Table
        Properties:
          TableName: moviesTwo
          AttributeDefinitions:
            - AttributeName: movieTitle
              AttributeType: S
          KeySchema:
            - AttributeName: movieTitle
              KeyType: HASH
          ProvisionedThroughput:
            ReadCapacityUnits: 5
            WriteCapacityUnits: 5
      DynamoDBIamPolicy:
        Type: AWS::IAM::Policy
        DependsOn: DynamoDbTable
        Properties:
          PolicyName: lambda-dynamodb
          PolicyDocument:
            Version: '2012-10-17'
            Statement:
              - Effect: Allow
                Action:
                  - dynamodb:GetItem
                  - dynamodb:PutItem
                Resource: arn:aws:dynamodb:*:*:table/moviesTwo
          Roles:
            - Ref: IamRoleLambdaExecution
  </code></pre>
  
  <p>My function in handler.js is:</p>
  
  <pre><code>module.exports.createMovie = (event, context, cb) =&gt; {  
    const params = {
      TableName: 'movies',
      Item: {
          "movieTitle": "Star Wars"
      }
    };
  
    return dynamo.put(params, cb);
  };
  </code></pre>
  
  <p>I ran serverless deploy and it worked on many levels. Created my lambda for me, gave me an endpoint and functions:</p>
  
  <blockquote>
    <p>endpoints:   POST -
    <a href="https://tbwg38fvc0.execute-api.us-east-1.amazonaws.com/dev/movies/create" rel="noreferrer">https://tbwg38fvc0.execute-api.us-east-1.amazonaws.com/dev/movies/create</a>
    functions:   serverless-dev-hello   serverless-dev-createMovie</p>
  </blockquote>
  
  <p>But I run it in postman and I get an internal server error, and I tried calling:
  serverless invoke -f serverless-dev-createMovie -l
  and it says:</p>
  
  <blockquote>
    <p>Serverless Error ---------------------------------------</p>
  
  <pre><code> Function "serverless-dev-createMovie" doesn't exist
   in this Service
  </code></pre>
  </blockquote>
  
  <p>So I am confused what I am doing wrong. Is there another setting in AWS I am missing that needs to be set for invoke to work?</p>