Re:AWS Lambda Terraform Cookbook with working examples
by gingerlime on Thursday December 31, 2020 @03:06AM
(#25590651)
I’ve never used Terraform, but isn’t it “intelligent” enough to apply only the changes necessary?
[ Parent
| on HN ]
Re:AWS Lambda Terraform Cookbook with working examples
by idunno246 on Thursday December 31, 2020 @03:42AM
(#25590817)
Yea, it’s that smart, but it’s a risk mitigation cause people make mistakes. You don’t really want the thing that casually you run many times a day to have the ability to accidentally delete your database. Security as well, our code deploy pipeline has less privileges than our terraform pipeline
Re:AWS Lambda Terraform Cookbook with working examples
by felixhuttmann on Thursday December 31, 2020 @03:11PM
(#25596623)
The risk of accidentially deleting the database is real. However, it can be mitigated without introducing another tool by using a second terraform root module (with a corresponding second statefile). So you would have one terraform root module for foundational or stateful things like databases which rarely change and should never be accidentially deleted, and a second terraform root module that holds only the lambda. The former root module is applied only manually, the latter can run automated in a pipeline.
Re:AWS Lambda Terraform Cookbook with working examples
by knowhy on Thursday December 31, 2020 @06:22AM
(#25591676)
The problem is that Terraform is stateful. Terraform will revert the Lambda code back to the state defined in Terraform when Terraform is applied after the code was updated outside of Terraform.
There is a way to mitigate this a by making Terraform ignore changes to the actual code of the Lambda.