title: CloudFormation - Structure of the SAM template is invalid. 'Resources' section is required
body: <p>I am trying to deploy a lambda using code pipepline and code deploy using sam yml but it fails with following error:
  FAILED - Transform AWS::Serverless-2016-10-31 failed with: Invalid Serverless Application Specification document. Number of errors found: 1. Structure of the SAM template is invalid. 'Resources' section is required</p>
  
  <p>The sam.yml is :</p>
  
  <pre><code>AWSTemplateFormatVersion: '2010-09-09'
  Transform: 'AWS::Serverless-2016-10-31'
  Description: Lambda1
  Resources:
  callDetails:
  Type: 'AWS::Serverless::Function'
  Properties:
    Handler: lambda_function.lambda_handler
    Runtime: python3.6
    CodeUri: .
    Description: 'Lambda Function'
    MemorySize: 128
    Timeout: 30
    Role: 'arn:aws:iam::XXXXXX:role/YYYYYYYYY'
    Environment:
      Variables:
        REGION: ap-southeast-2
  </code></pre>
  
  <p>The buildspec.yml has the following command 
  - aws cloudformation package --template-file samTemplate.yaml --s3-bucket XXXX --output-template-file outputSamTemplate.yaml</p>
  
  <p>the outputSamTemplate :</p>
  
  <pre><code>enter code here
  
  AWSTemplateFormatVersion: '2010-09-09'
  Description: Lambda Function
  Resources:
   callDetails:
    Properties:
     CodeUri: s3://TTTTTTTTTTTTT/CCCCCCCCC
     Description: callDetails Lambda Function
     Environment:
       Variables:
         REGION: ap-southeast-2
     Handler: lambda_function.lambda_handler
     MemorySize: 128
     Role: arn:aws:iam::XXXXX:role/validationsLambdas
     Runtime: python3.6
     Timeout: 30
    Type: AWS::Serverless::Function
   Transform: AWS::Serverless-2016-10-31
  </code></pre>