Terraform command to download configuration of resources that is compatible to the module main.tf format

  Kiến thức lập trình

I have a lab system where I have some resources. I want to replicate that into another system and manage it in the new system using terraform.
Is there a terraform command that downloads the configuration of the resources from the lab system, that I can then use in the resource module main.tf file?

I tried terraform import module.resourcename resourceid
But this imported the resource , but in the terraform.state file and it was not in a format I can use in the module’s main.tf file, so that I can apply it to a new system.

New contributor

Aparna Ravindranath is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.