[Solved] Instance Profile already exists in Terraform

If you get the Instance Profile already exists error when running your Terraform apply, then it is either because an instance profile with that name already existed in the account, or because the previous terraform destroy did not remove it.

Step 1 – Identify the Instance Profiles in the account

aws iam list-instance-profiles
Code language: Bash (bash)

Step 2 – Delete the Instance Profile/s

aws iam delete-instance-profile --instance-profile-name <name-of-instance-profile>
Code language: Bash (bash)

Notify of
Inline Feedbacks
View all comments