How to import manual changes into Terraform remote state

Viewed 13579

I am new to terraform - I have created remote tfstate in s3, and now there are some manual changes too that are done in my AWS infrastructure. I need to import those manual changes into tfstate.

I used the import command for some resources, but for some resources such as IAM policy etc, there is no such import command.

Also some resources such as DB are changed with new parameters added, and I need to import them as well. When I try to import those changes it says:

Error importing: 1 error(s) occurred:

* Can't import aws_security_group.Q8SgProdAdminSshInt, would collide
  with an existing resource.

Please remove or rename this resource before continuing.

Any help would be appreciated. Thanks.

2 Answers
Related