If you manually delete a resource that is being managed by terraform, it it not removed from the state file and becomes "orphaned".
You many see errors like this when running terraform:
1 error(s) occurred:
* aws_iam_role.s3_readonly (destroy): 1 error(s) occurred:
* aws_iam_role.s3_readonly (deposed #0): 1 error(s) occurred:
* aws_iam_role.s3_readonly (deposed #0): Error listing Profiles for IAM Role (s3_readonly) when trying to delete: NoSuchEntity: The role with name s3_readonly cannot be found.
This prevents terraform from running, even if you don't care about the missing resource such as when you're trying to delete everything, ie. running
Fortunately, terraform has a command for exactly this situation, to remove a resource from the state file:
terraform state rm <name of resource>
In the example above, the command would be
terraform state rm aws_iam_role.s3_readonly