title: How do I get Cloud Formation to create a changeset to update my Lambda functions?
body: <p>I have a Lambda function which I've verified to work correctly. I'm able to update the function by hand on the command line using "update-function-code" but I've been trying to get it working with Code Pipeline and Cloud Formation. 
  Here are the steps I have so far:</p>
  
  <ol>
  <li>Source - fetch the code from github. This works correctly.</li>
  <li>Build - test the code in Solano (3rd party CI). This works too and on the last stage it zips up the repo and uploads it to my S3 bucket.</li>
  <li>Deploy - This is the "deploy" action category with the action mode "create or replace a change set". This doesn't work if the Lambda function already exists.</li>
  <li>Beta - Execute the changeset. This works if the change set was generated correctly.</li>
  </ol>
  
  <p>My samTemplate.yml looks like this:</p>
  
  <p><code>AWSTemplateFormatVersion: '2010-09-09'
  Transform: AWS::Serverless-2016-10-31
  Description: My Lambda function
  Resources:
    LambdaFunction:
      Type: AWS::Serverless::Function
      Properties:
        FunctionName: MyLambdaExecute
        Description: My Lambda function
        Handler: myhandler.handler
        Runtime: nodejs6.10
        CodeUri: s3://mybucket/mydirectory/mylambdacode.zip
        AutoPublishAlias: Staging
        Timeout: 30
        DeploymentPreference:
          Type: AllAtOnce</code></p>
  
  <p>If the lambda function with the name "MyLambdaExecute" doesn't exist and I push up code to github, it works perfectly. But if I modify some code and push again it runs the first two steps, but then generates an empty change set with the status:</p>
  
  <blockquote>
    <p>FAILED - No updates are to be performed.</p>
  </blockquote>
  
  <p>I'm not sure what I have to do to get it to publish a new version. How do I get it to realize it needs to create a new changeset?</p>