Open juergenz opened 1 month ago
This issue has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 10 days
I could not reproduce this issue. It works like it should, changes are being tracked properly.
Please make sure that you do terraform refresh
before terraform plan
(it is turned on, by default).
If you would want to not keep track of changes then you can set ignore_source_code_hash
to true
.
I could not reproduce this issue. It works like it should, changes are being tracked properly.
Please make sure that you do
terraform refresh
beforeterraform plan
(it is turned on, by default).If you would want to not keep track of changes then you can set
ignore_source_code_hash
totrue
.
Faced the same issue, doing a change to the code through the AWS Console (directly through the code editor, no zip upload etc.).
This code change results in a change for the SHA256 hash
which is also reflected in the terraform state.
e.g. for some lambda resource terraform state show "module.application_lambda.aws_lambda_function.this[0]"
Will give you the updated code_sha256
but the source_code_hash
won't be updated/changed, when doing manual code changes through the AWS Console.
I guess the code_sha256
is not used to decide if the resource has been changed but only the source_code_hash
and the source_code_hash
is not updated when doing changes through the AWS Console.
Description
Changing the code of a lambda funtion in AWS console does not get detected by a subsequent terraform run.
Versions
Module version [Required]: 7.7.0
Terraform version: Terraform v1.9.2
Provider version(s): provider registry.terraform.io/hashicorp/aws v5.59.0 provider registry.terraform.io/hashicorp/external v2.3.3 provider registry.terraform.io/hashicorp/local v2.5.1 provider registry.terraform.io/hashicorp/null v3.2.2
Reproduction Code [Required]
Steps to reproduce the behavior:
Deploy lambda funtion -
terraform apply
Confirm there are no pending changes -terraform plan
/terraform apply
Change and deploy code in AWS console - e.g. insert aprint("test")
Runterraform plan
againExpected behavior
A change to source_code_hash should be detected.
Actual behavior
No change is detected.
Additional context
Not sure if this is intended behavior looking at following code but from my perspective it would be useful to have the option to always check for a drift of source_code_hash.