clever-painter-96148
01/14/2023, 10:30 AMpulumi import
, how should we handle resources that do not actually exist, like providers and components?
Context: I reimplemented a legacy TF code base with Pulumi. Now I want to write a script that generates a resources.json
import file based on the terraform state.
According to https://www.pulumi.com/docs/guides/adopting/import/, id
is mandatory, but when reading a Pulumi state file, components have no ID.resources.json
file that import resources with components as parents?opts=ResourceOptions(import_="cloud-provider-identifier")
makes it much easier!ancient-policeman-24615
01/14/2023, 6:19 PMimport
is essentially a way to tell Pulumi: “grab the underlying state of a resource from a cloud provider”. I think you’ll need to add components and providers after you run the import.clever-painter-96148
01/17/2023, 9:38 AMopts=ResourceOptions(import_="cloud-provider-identifier")
did the trick. I am now able to import all legacy resources into my Pulumi state, with components. 🙂