I have a lambda which I want to invoke once during terraform apply since it updates a database and should be triggered only once in the apply phase.
My problem is that terraform invokes it during the plan phase as well.
Is there a way to run it only during the apply phase?
Example:
data "aws_lambda_invocation" "run_lambda" {
function_name = "test"
input = <<JSON
{}
JSON
}