-
Notifications
You must be signed in to change notification settings - Fork 9.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aws_lambda_function does not use partial state and will update the "filename" property even when it can't be read. #25886
Comments
I ran into the similar problem with the
AWS provider version: v4.30.0 |
The root cause of this issue is described in hashicorp/terraform-plugin-sdk#476. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
Terraform CLI and Terraform AWS Provider Version
AWS v.4.22.0
Affected Resource(s)
aws_lambda_function
Terraform Configuration Files
First apply this
Then change filename to a nonexistent file:
Output:
unable to load "nonexistent.zip": open nonexistent.zip: no such file or directory
at first, but if you apply again, it goes through
No changes. Your infrastructure matches the configuration.
Expected Behavior
Upon failure, filename isn't updated
Actual Behavior
Filename is updated
Steps to Reproduce
terraform apply
a proper lambda functionterraform apply
again and fail.terraform apply
again and you will succeed?!Important Factoids
Look around this line of the provider. No partial state is implemented in regards to updating filename:
terraform-provider-aws/internal/service/lambda/function.go
Line 1221 in d4c9e27
Loock at the docs of the Terraform Custom Providers Page:
The aws_lambda_function does not implement partial state in regards to updating fields that don't exist on AWS like "filename". Because of this, failure to read in a file will still save the updated filename in the diff. This is definitely not desired behavior and exacerbates problems lambda implementations such as the aws lambda module.
The text was updated successfully, but these errors were encountered: