Search⌘ K

Troubleshooting with Terraform

Explore how to troubleshoot typical Terraform errors encountered when managing AWS EKS clusters, including entity duplication and VPC limits. Understand practical solutions such as detaching IAM policies, deleting duplicate roles, and cleaning up VPC resources to maintain your infrastructure effectively.

EntityAlreadyExists error

The EntityAlreadyExists error might come up after applying a definition. Possible causes for this could be:

  • Duplication of entities.
  • Incomplete execution of code.
  • Not destroying already created resources.

To resolve this error, we’ll follow this script.

Shell
aws iam list-attached-role-policies --role-name [rollname...]
aws iam detach-role-policy --role-name [rollname...] --policy-arn [policy arn...]
aws iam delete-role --role-name [rollname...]

Note: Replace [rolename ...] with the role name of the entity that already exists.

  • The ...