cloudposse / terraform-aws-lambda-function

A module for launching Lambda Fuctions
https://cloudposse.com/accelerate
Apache License 2.0
30 stars 40 forks source link

ignore last_modified attribute #23

Closed codekitchen closed 2 years ago

codekitchen commented 2 years ago

what

why

In the past I've used this module with a local filename without issue, but we just used it with a new lambda function whose code we are storing externally in S3 so using the s3_key/s3_bucket attributes, and on every terraform apply it wants to update the last_modified attribute e.g.:

Terraform will perform the following actions:

  # module.xxx.aws_lambda_function.this[0] will be updated in-place
  ~ resource "aws_lambda_function" "this" {
        id                             = "xxx"
      ~ last_modified                  = "2022-07-05T22:43:11.813+0000" -> (known after apply)
        tags                           = {}
        # (20 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

Adding this lifecycle rule avoids this spurious update. I'm open to other suggestions though!

aknysh commented 2 years ago

/test all