this is something you can do with terraform. For each resource that you want to import from your infrastructure you'll need to pass some args to terraform CLI.
So, for instance, if you want to import an exists cognito pool from AWS to terraform state you can use the following command:
terraform import aws_cognito_identity_pool.my_resource cognito_resource_id
Whereas the "my_resource" would be a terraform resource block inside your .tf file:
resource "aws_cognito_user_pool" "my_resource" {}
And the cognito_resource_id would be the pool id showing in your aws console.
If you go to documentation you'll find an "import" block, but not all resources can be imported, I suggest you go there and check each resource to double check if it can be imported.
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cognito_user_pool#import
I use a lot this import command to reverse engineering stufs, sometime is very confusing create all directly from terraform, in this scenario I try to create the thing on AWS console and then import with terraform.
After import you can check all the configurations that come with it using the following command:
terraform state show module.cognito.aws_cognito_user_pool_client.my_resource
In case you don't use module you can ignore the "module"and just use the rest.