You can do something like:
resource "aws_lambda_function" "my_lambda" { filename = "lambda.jar" function_name = "${local.my_function_name}" handler = "${var.lambda_type == "java" ? "Handler" : "index.handler"}" runtime = "${var.lambda_type == "java" ? "java8" : "nodejs10.x"}" }
and no need to create 2 resources, and data to refer the one that got created.
I havn't tested your suggestion but it seems to be a great solution ! I'll definitvly test that next time !
Thanks for your comment.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
You can do something like:
and no need to create 2 resources, and data to refer the one that got created.
I havn't tested your suggestion but it seems to be a great solution ! I'll definitvly test that next time !
Thanks for your comment.