Terraform Scripts from AWS Infrastructure

Hello,

Is there a way to generate Terraform Scripts from AWS infrastructure that already exists? The reason we want to use scripts to manage our environmnet.

We are migrating Server to the cloud AWS using CloudEndure and want to generate a state file after the migration is completed.

Thanks
Khurshid