How to import already created AWS resources in TF CDK

Hi Team,

I’ve been working with TF CDK and able to complete a successful POC - I am looking for ways to import the already existing entities on my AWS Console.

If the existing resources were created with Terraform, you can use the from-terraform-project when initializing a cdktf project to convert the configuration. You’ll likely need to tweak a couple things by hand, but then you should be good to go.

If they weren’t created with Terraform, you have a couple options.

  • Use a tool to generate Terraform and then follow the above procedure. I have not personally used any of these tools, so I can’t speak to how will that will work.
  • Create cdktf code that mirrors the structure of the existing resource. You can then use Terraform to import the existing resources into the new configuration. See Import - Terraform by HashiCorp for more information on importing.