When a resource already exists, introduce functionality that auto reports in the error message the correct way said resource can be imported.
A read operation should therefore be performed when the EntityAlreadyExists error occurs. The resultant information can be used to populate import input.
- Error creating [resource-type] [resource-name]: EntityAlreadyExists: [resource-type] with [resource-name] already exists. status code: 409, request id:
+ Error creating [resource-type] [resource-name]: EntityAlreadyExists: [resource-type] with [resource-name] already exists. status code: 409, request id:...
+ import using $ terraform import [resource-type].[resource-name] [resource-id]
Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
Volunteering to Work on This Issue
If you are interested in working on this issue, please leave a comment.
If this would be your first contribution, please review the contribution guide.
Description
When a resource already exists, introduce functionality that auto reports in the error message the correct way said resource can be imported. A read operation should therefore be performed when the
EntityAlreadyExists
error occurs. The resultant information can be used to populate import input.example:
where the ID
tgw-attach-12345678
would have been computed having tried to create an already present peering.Affected Resource(s) and/or Data Source(s)
No response
Potential Terraform Configuration
No response
References
No response
Would you like to implement a fix?
No