title: AWS Serverless Application Model (SAM) -- How do I change StageName?
body: <p>I'm using AWS SAM (Serverless Application Model) to create a lambda with an API endpoint.</p>
  
  <p>In my SAM template.yaml I have a getUser lambda with a /user endpoint.</p>
  
  <p><strong>template.yaml</strong></p>
  
  <pre><code>Resources:
    GetUser:
      Type: AWS::Serverless::Function
      Properties:
        CodeUri: ./src
        Handler: handler.getUser
        Timeout: 300
        Runtime: nodejs6.10
        Events:
          GetUser:
            Type: Api
            Properties:
              Path: /user
              Method: get
  </code></pre>
  
  <p>When I deploy this using AWS CLI it successfully creates the lambda and endpoint, but with an API Gateway Stage confusingly named "Stage". I want to change stage name to something else, like "Prod". How do I change stage name?</p>
  
  <p>Here's where stage name is defined in the cloudformation template after it is deployed. I want "StageName": "Stage" to be something like "StageName": "Prod".</p>
  
  <pre><code>"ServerlessRestApiDeployment": {
    "Type": "AWS::ApiGateway::Deployment",
    "Properties": {
      "RestApiId": {
        "Ref": "ServerlessRestApi"
      },
      "StageName": "Stage"
    }
  </code></pre>