How do I modify a Terraform plan to work with existing resources?

Hi!
I’m trying to modify this Terraform plan to work with an existing legacy GKE cluster (which does not have a Terraform plan, I think, it was hand rolled).
I want to be able to have it run an apply and deploy all the needed services so that they work together.
I simply cannot find any information on how to do this beyond import a resource.
It seems like Terraform is not really set up to modify extant resources?
Also I’m not clear if all the subnets and other helper resources will work correctly.

I have no experience with metaflow, so I’m just extrapolating based on general knowledge of Terraform, Kubernetes, and software deployed on Kubernetes here…

Realistically, I think you have two viable options:

  1. Just destroy your legacy cluster and build a new one using Terraform from scratch.

  2. Take bits and pieces from metaflow’s example Terraformed setup, and use it to construct your own, which only manages the new resources you are deploying, substituting in authentication to your existing cluster provided manually, and use of Terraform data sources where needed to look up IDs of existing infrastructure.

Ultimately, when working with any infrastructure-as-code tool (this is not unique to Terraform), if, as is the case here, someone ships an example to deploy a Kubernetes cluster and some services, and you want to peel off the “some services” layer and substitute your own lower layers - then you give up the possibility of using the example as a single unit. You inevitably find yourself needing to investigate its internals, to figure out where to draw a boundary and what the interfaces across that boundary need to be.