Aws_lambda_function gets file hash different from the one exported by archive_file

Despite zip file is not changed lambda is updating with archive every apply

# zip lambda archive
data "archive_file" "lambda_zip" {
  type          = "zip"
  source_file   = "${path.module}/src/${local.fullname}.rb"
  output_path   = "${path.module}/src/${local.fullname}.zip"
}

resource "aws_lambda_function" "func" {
  filename         = "${path.module}/src/${local.fullname}.zip"
  function_name    = "lsm_${local.basename}"
  role             = aws_iam_role.recyclerLambda.arn
  handler          = "${local.fullname}.lambda_handler"
  source_code_hash = data.archive_file.lambda_zip.output_base64sha256
  runtime          = "ruby2.5"
  tags = {
bt_tier = var.bt_tier
deployed_by = "Terraform"
  }
}

The same with md5 checksum. The actual checksum of file on FS is not changing.
Please advice

Thanks,
Sergii

I have the same problem and if I run terraform in the same docker image, but on different hosts one is local docker, the other is part of Argo workflow (but using the same terraform docker image) zip file md5sum has is different value, but file content is the same.

@szemlyanoy I was able to find what is my problem and the reason for different md5/base64 encoding for the zip file on different hosts is that in our Argo workflow server generated terraform cache files were with permissions 666, while on my local machine and by default on UNIX systems this mode should be 644 as umask is 022.
After setting proper file permissions (setting umask 022 in execution script) then md5/base64 for zip file was the same across local and Argo workflow (CI) terraform execution.