-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
terraform-provider-aws 3.13.0 and later including 3.25.0 cause lambdas in a VPC to be updated on every apply #17385
Comments
Hi, hitting this issue as well. Strangely enough it only happens when a Lambda function is configured with VPC settings. It's super annoying because it's forcing codeDeploy deployments every time :(
After having initialized the module and applied it. No changes to the resources, and trigger a terraform apply: An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
~ update in-place
Terraform will perform the following actions:
# module.lambda_function_no_vpc_instantdeploy.module.lambda_function.aws_lambda_function.this[0] will be updated in-place
~ resource "aws_lambda_function" "this" {
id = "TestLambdaVPC-"
~ qualified_arn = "arn:aws:lambda:eu-west-2:12345678:function:TestLambdaVPC:3" -> (known after apply)
tags = {}
~ version = "3" -> (known after apply)
# (18 unchanged attributes hidden)
# (3 unchanged blocks hidden)
}
Plan: 0 to add, 1 to change, 0 to destroy. |
Looks like without |
As reported in #17385 a change i detected in vpc_config when there are no changes, this is caused by an issue in hashicorp/terraform-plugin-sdk#617 The PR to provide a fix is not getting any traction. On further debuging the issue is caused by the nested elements being of type set which needs the use of Equal rather than reflect.DeepEqual to test for differences. We can work around this bug by testing for changes in the two fields within vpc_config independantly as when the item passed to HasChanges is a Set it is tested correctly.
Hi @akloss-cibo & @kitos9112, |
@bill-rich haven't tested it with the new provider yet. I'll give it a go this morning and comment back. |
Fixed for me starting in 3.45.0. |
This seems to have been resolved, so closing for now. 👍 Please comment on the issue to reopen if this behaviour can be demonstrated in a version greater than |
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
Affected Resource(s)
aws_lambda_function
aws_iam_role
👈 I have observed a similar problem with aws_iam_role in 3.12.0 as well.Terraform Configuration Files
Debug Output
The debug output has a lot of sensitive data in it, including AWS credentials, so I'm including regular output.
https://gist.github.com/akloss-cibo/6eaf77d79ea9d91837baa94fca74173d
Expected Behavior
The lambda function should be updated once, and then left alone.
Actual Behavior
In every apply, the lambda function shows a change, which is then applied although is functionally a no-op.
Steps to Reproduce
lambda.tf
with terraform config from above. Substitute in a correct IAM role, and correct VPC informationzip lambda.zip lambda.tf
to create a dummy zipterraform init
terraform apply -auto-approve
to create the lambda functionterraform apply
again. Observe that the plan shows a trivial change. Apply that change. Repeat.References
The text was updated successfully, but these errors were encountered: