-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
TF tries to destroy Lambda function which was manually deleted #16158
Comments
Related:
Yes, we are not handling that error: terraform-provider-aws/aws/resource_aws_lambda_function.go Lines 677 to 692 in ee1bcab
|
@ewbankkit I'm not sure how it works in other function where this is handled properly. |
Would this behavior almost be expected due to the fact that terraform is relying solely on the tfstate where this lambda still resides? I suppose just removing the state on |
Generally, Terraform should be refreshing the resource state in the planning phase before destroy, which is a common scenario we handle to automatically remove resources from state when receiving "resource not found" type errors. However, this error is possible for operators when (currently, potentially not in the future) working around that behavior with the not recommended Terraform AWS Provider resources should ignore "resource not found" type errors in their _, err := conn.DeleteFunction(params)
if tfawserr.ErrCodeEquals(err, lambda.ErrCodeResourceNotFoundException) {
return nil
}
if err != nil {
return fmt.Errorf("error deleting Lambda Function (%s): %w", d.Id(), err)
} If anyone is interested in fixing this, the code lives in |
@bflad I can take it. |
Hi @ZsoltPath, preventing the error behavior during a |
Yay! Thanks all!
…On Thu, 3 Dec 2020, 17:36 angie pinilla, ***@***.***> wrote:
Hi @ZsoltPath <https://github.com/ZsoltPath>, preventing the error
behavior during a terraform destroy has been addressed with the merge of
#16183 <#16183>,
which will release with the upcoming release of v3.20.0 of the Terraform
AWS Provider .
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#16158 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOLGJ2KVUVY3RRKLDM4SO6TSS7EA5ANCNFSM4TTDBQMQ>
.
|
This has been released in version 3.20.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks! |
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. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Community Note
Terraform CLI and Terraform AWS Provider Version
Affected Resource(s)
Debug Output
Can't upload a 60MB log to Gist.
Expected Behavior
I expect TF to discover that the resource is already deleted outside of TF and don't even list it as a task for the destroy.
Actual Behavior
TF lists the Lambda function as a resource to delete then the API call fails.
Steps to Reproduce
Important Factoids
It is a Lambda@Edge in us-east-1 region
The text was updated successfully, but these errors were encountered: