There is no way to determine in Terraform whether the role linked to the service has already been created in the AWS account.
So, you must manually check and, if it not exists, set create_iam_service_linked_role to true, otherwise, set it to false or leave as default.
We haven't found a better way to do this.
Error: error creating capacity provider: ClientException: ECS Service Linked Role does not exist. Please create a Service linked role for ECS and try again.
There is no way to determine in Terraform whether the role linked to the service has already been created in the AWS account. So, you must manually check and, if it not exists, set create_iam_service_linked_role to true, otherwise, set it to false or leave as default. We haven't found a better way to do this.