How to make Terraform archive_file resource pick up changes to source files?
<p>Using TF 0.7.2 on a Win 10 machine.</p>

<p>I'm trying to set up an edit/upload cycle for development of my lambda functions in AWS, using the new "archive_file" resource introduced in TF 0.7.1</p>

<p>My configuration looks like this:</p>

<pre><code>resource "archive_file" "cloudwatch-sumo-lambda-archive" {
  source_file = "${var.lambda_src_dir}/cloudwatch/cloudwatchSumologic.js"
  output_path = "${var.lambda_gen_dir}/cloudwatchSumologic.zip"
  type = "zip"
}

resource "aws_lambda_function" "cloudwatch-sumo-lambda" {
  function_name = "cloudwatch-sumo-lambda"
  description = "managed by source project"
  filename = "${archive_file.cloudwatch-sumo-lambda-archive.output_path}"
  source_code_hash = "${archive_file.cloudwatch-sumo-lambda-archive.output_sha}"
  handler = "cloudwatchSumologic.handler"

  ...
}
</code></pre>

<p>This works the first time I run it - TF creates the lambda zip file, uploads it and creates the lambda in AWS.
The problem comes with updating the lambda.</p>

<p>If I edit the cloudwatchSumologic.js file in the above example, TF doesn't appear to know that the source file has changed - it doesn't add the new file to the zip and doesn't upload the new lambda code to AWS.</p>

<p>Am I doing something wrong in my configuration, or is the archive_file resource not meant to be used in this way?</p>