When running the command terraform apply
the following error occurred because the role already exists.
Error: Error creating IAM Role iam_for_lambda: EntityAlreadyExists: Role with name iam_for_lambda already exists.
status code: 409, request id: 204c6c00-0b1d-4fb9-bf9c-fca48c67d669
on main.tf line 1, in resource "aws_iam_role" "iam_for_lambda":
1: resource "aws_iam_role" "iam_for_lambda" {
can I use conditions/tricks to check without error if the role already exists?