I want to import existing aws resource iam-role 'DEVOPS' to my terraform management.
Though the resorce exists i get the following error -
Error: Cannot import non-existent remote object
While attempting to import an existing object to aws_iam_role.okta_devops_role, the provider detected that no object exists with the given id. Only pre-existing objects can be imported; check that the id is correct and that it is associated with the provider's configured region or endpoint, or use "terraform apply" to create a new remote object for this resource.
I created empty resource -> aws_iam_role.devops_role in my main.tf
aws_iam_role.okta_devops_role
and you should be able to import by doing what @eatsfood stated. I believe it would be something liketerraform import aws_iam_role.okta_devops_role DEVOPS
assuming that DEVOPS is the name of the role that you want to import – Peter Arboleda