daher:
hey there, i get an error in terraform saying that the iam user resource already exists,
- is there a possibility to skip it if the resource already exists (or)
- again delete it and create it from the terraform itself when it encounters something like this.
Ghulam Muhee. Uddin:
please paste the error in this thread
Mohamed Ayman:
Hello @daher,
it seems that this resource"iam" is not created by terrform, So, you should import it to tfstate using terraform import resource resource-name/id
eg: terrafrom import aws_iam_role test_role
daher:
no this is not the answer im looking for… when i ran the terraform apply last time, it created the resources and when i try to run it again, it says the resource already exists
Aditya:
@daher as a first step to resolution try a terraform state list and confirm if your state file indeed include the iam resource in question.