Loading...
Loading...
### Terraform Version ```shell 1.10.5 ``` ### Terraform Configuration Files data "archive_file" "ec2_start" { type = "zip" source_file = "${path.module}/ec2_start_code/lambda_function.py" output_path = "ec2start.zip" } resource "aws_lambda_function" "ec2_start_lambda" { function_name = "ec2-start-lambda" filename = "ec2start.zip" source_code_hash = data.archive_file.python_ec2_start.output_base64sha256 role = aws_iam_role.ec2_start_stop_role.arn runtime = "python3.9" handler = "lambda_function.lambda_handler" timeout = 10 environment { variables = { ENVIRONMENT = var.environment } } } ### Debug Output source_code_hash getting changed each time I run terraform plan/apply which incase is changing the last modified time of the function in AWS console without making any modifications in the code. This is sort of misleading ### Expected Behavior source_code_hash only should change when there is a change in the function code. Kindly provide a workaround to fix this issue ### Actual Behavior source_code_hash getting changed each time I run terraform plan/apply which incase is changing the last modified time of the function in AWS console without making any modifications in the code. This is sort of misleading ### Steps to Reproduce terraform plan terraform apply ### Additional Context source_code_hash getting changed each time I run terraform plan/apply which incase is changing the last modified time of the function in AWS console without making any modifications in the code. This is sort of misleading. Expected Behaviour source_code_hash only should change when there is a change in the function code. Thereby lambda modification timestamp should only change when there is a change in the source code. Kindly provide a workaround to fix this issue. ### References _No response_ ### Generative AI / LLM assisted development? _No response_
Click on a version to see all relevant bugs
Terraform Integration
Learn more about where this data comes from
Bug Scrub Advisor
Streamline upgrades with automated vendor bug scrubs
BugZero Enterprise
Wish you caught this bug sooner? Get proactive today.