Terraform lambda source_code_hash update with same code

前端 未结 4 635
抹茶落季
抹茶落季 2021-01-04 07:27

I have an AWS Lambda deployed successfully with Terraform:

resource \"aws_lambda_function\" \"lambda\" {
  filename                       = \"dist/subscriber         


        
4条回答
  •  清歌不尽
    2021-01-04 07:52

    As others have said, your zip should be used in your filename and your hash.

    I want to mention that you can also get similar recreation issues if you use the wrong hash function in your lambda definitions. For example filesha256(.zip) will also recreate your lambdas every time. You have to use filebase64sha256("file.zip") (terraform 0.11.12+) or base64sha256(file("file.zip")) as mentioned under source_code_hash here

提交回复
热议问题