title: Execution failed due to configuration error: Invalid permissions on Lambda function
body: <p>I am building a serverless application using AWS Lambda and API Gateway via Visual Studio. I am working in C#, and using the serverless application model (SAM) in order to deploy my API. I build the code in Visual Studio, then deploy via publish to Lambda. This is working, except every time I do a new build, and try to execute an API call, I get this error: </p>
  
  <p><em>Execution failed due to configuration error: Invalid permissions on Lambda function</em></p>
  
  <p>Doing some research, I found this fix mentioned elsewhere (to be done via the AWS Console):</p>
  
  <p><em>Fix: went to API Gateway > API name > Resources > Resource name > Method > Integration Request > Lambda Function and reselected my existing function, before "saving" it with the little checkmark.</em> </p>
  
  <p>Now this works for me, but it breaks the automation of using the serverless.template (JSON) to build out my API. Does anyone know how to fix this within the serverless.template file? So that I don't need to take action in the console to resolve? Here's a sample of one of my methods from the serverless.template file</p>
  
  <pre><code>{
    "AWSTemplateFormatVersion" : "2010-09-09",
    "Transform" : "AWS::Serverless-2016-10-31",
    "Description" : "An AWS Serverless Application.",
  
    "Resources" : {
  
      "Get" : {
        "Type" : "AWS::Serverless::Function",
        "Properties": {
          "VpcConfig":{
            "SecurityGroupIds" : ["sg-111a1476"],
            "SubnetIds" : [ "subnet-3029a769","subnet-5ec0b928"]
          },
          "Handler": "AWSServerlessInSiteDataGw::AWSServerlessInSiteDataGw.Functions::Get",
          "Runtime": "dotnetcore2.0",
          "CodeUri": "",
          "MemorySize": 256,
          "Timeout": 30,
          "Role": null,
          "Policies": [ "AWSLambdaBasicExecutionRole","AWSLambdaVPCAccessExecutionRole","AmazonSSMFullAccess"],
          "Events": {
            "PutResource": {
              "Type": "Api",
              "Properties": {
                "Path": "/",
                "Method": "GET"
              }
            }
          }
        }
      },
  </code></pre>