title: Terraform lambda function validation exception
body: <p>I am trying to set up my current infrastructure in Terraform (v 0.13.0). I am simply starting with migrating existing lambda functions. I have used the following code to try upload an existing lambda function in .net core 3.1 to AWS (provider v. 3.0). I have no issue to deploy this manually but this is obviously not the goal.</p>
  <p>Here is the IAM role:</p>
  <pre><code>resource &quot;aws_iam_role&quot; &quot;role_lambda&quot; {
    name = &quot;roleLambda&quot;
  
    assume_role_policy = &lt;&lt;POLICY
    {
      &quot;Version&quot;: &quot;2012-10-17&quot;,
      &quot;Statement&quot;: [
        {
          &quot;Action&quot;: &quot;sts:AssumeRole&quot;,
          &quot;Principal&quot;: {
            &quot;Service&quot;: &quot;lambda.amazonaws.com&quot;
          },
          &quot;Effect&quot;: &quot;Allow&quot;,
          &quot;Sid&quot;: &quot;&quot;
        }
      ]
    }
    POLICY
    }
  </code></pre>
  <p>Below the function (note I have obfuscated some values):</p>
  <pre><code>resource &quot;aws_lambda_function&quot; &quot;lambda_tf&quot; {
    function_name     = &quot;LambdaTFTest&quot;
    role              = aws_iam_role.role_lambda.arn
    handler           = &quot;Lambda::Lambda.Function::FunctionHandler&quot;
    runtime           = &quot;dotnetcore3.1&quot;
    s3_bucket         = &quot;arn:aws:s3:::xxxx-xxxxxx&quot;
    s3_key            = &quot;Lambda.zip&quot;
    s3_object_version = &quot;XxXxXxXxXxXxXxXxXxXxXxXxXxXx&quot;
  }
  </code></pre>
  <p>However I keep getting this error as an output with no more details:</p>
  <pre><code>Error: Error creating Lambda function: ValidationException: 
          status code: 400, request id: a5e89c38-d1f1-456d-93c1-41650fb45386
  </code></pre>
  <p>I already made sure that my lambda is deployed within the same region as the s3 bucket itself so this is not the issue. I thought this could be related to some invalid parameters but I have played with all of them and can't manage to find the problem. I have also double checked the correct spelling of the key, version and so on. How can I make progress on this ?</p>
  <p>Thanks in advance for your help.</p>