title: Terraform lambda source_code_hash update with same code
body: <p>I have an AWS Lambda deployed successfully with Terraform:</p>
  
  <pre><code>resource "aws_lambda_function" "lambda" {
    filename                       = "dist/subscriber-lambda.zip"
    function_name                  = "test_get-code"
    role                           = &lt;my_role&gt;
    handler                        = "main.handler"
    timeout                        = 14
    reserved_concurrent_executions = 50
    memory_size                    = 128
    runtime                        = "python3.6"
    tags                           = &lt;my map of tags&gt;
    source_code_hash               = "${base64sha256(file("../modules/lambda/lambda-code/main.py"))}"
    kms_key_arn                    = &lt;my_kms_arn&gt;
    vpc_config {
      subnet_ids         = &lt;my_list_of_private_subnets&gt;
      security_group_ids = &lt;my_list_of_security_groups&gt;
    }
    environment {
      variables = {
        environment = "dev"
      }
    }
  }
  </code></pre>
  
  <p>Now, when I run <code>terraform plan</code> command it says my lambda resource needs to be updated because the <code>source_code_hash</code> has changed, but I didn't update lambda Python codebase (which is versioned in a folder of the same repo):</p>
  
  <pre><code>  ~ module.app.module.lambda.aws_lambda_function.lambda
    last_modified:                     "2018-10-05T07:10:35.323+0000" =&gt; &lt;computed&gt;
    source_code_hash:                  "jd6U44lfe4124vR0VtyGiz45HFzDHCH7+yTBjvr400s=" =&gt; "JJIv/AQoPvpGIg01Ze/YRsteErqR0S6JsqKDNShz1w78"
  </code></pre>
  
  <p>I suppose it is because it compresses my Python sources each time and the source changes. How can I avoid that if there are no changes in the Python code? Is my hypothesis coherent if I didn't change the Python codebase (I mean, why then the hash changes)?</p>