Provider error when deploying Lambda layer

I have terraform configuration file for creating lambda layer with the code package in s3.

below my code :

resource “aws_s3_bucket_object” “nodejs_lambda_layer” {
bucket = data.terraform_remote_state.app_common.outputs.bucket_kyc_id[0]
key = “layer/{}" source = "{path.module}/packages/sls/”
etag = filemd5("${path.module}/packages/sls/")

resource “aws_lambda_layer_version” “nodejs_lambda_layer” {
s3_bucket = data.terraform_remote_state.app_common.outputs.bucket_kyc_id[0]
s3_key =
s3_object_version = aws_s3_bucket_object.nodejs_lambda_layer.version_id
layer_name = “${}-sls-node”
source_code_hash = base64encode(aws_s3_bucket_object.nodejs_lambda_layer.etag)
compatible_runtimes = [“nodejs12.x”]

When deploying via jenkins i get the following error :

Error: Provider produced inconsistent final plan

When expanding the plan for aws_lambda_layer_version.nodejs_lambda_layer to
include new values learned so far during apply, provider” produced an invalid new value for
.source_code_hash: was
ty.StringVal(“MTZhMDI3ZTc3ZGYxODJjMjRhNzU0MWU3NDQ4ZTZjNTc=”), but now

This is a bug in the provider, which should be reported in the provider’s own
issue tracker.

Best regards