Import an existing resource
Put a resource that already exists under Terraform control
terraform import module.path.resource_type.name <remote-id>
More terraform commands
-
terraform state show module.path.resource_type.nameShow the state attributes of one resource
-
terraform state mv old.address new.addressRename or move a resource without destroying and recreating it
-
terraform workspace listShow all workspaces; the current one is marked with *
-
terraform workspace new staging && terraform workspace select stagingCreate a new workspace and switch to it
-
terraform validateCheck Terraform configuration for syntax and consistency errors